﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="skags.Models" %>

<ul>
<%
    foreach( var c in (IEnumerable<PageViewModel>)ViewData["Pages"] )
    {
        Response.Write("<li><a href=\"/Home/Page/" + c.ID + "\">" + c.Title + "</a>");

        Response.Write("<ul>");
        
        foreach( var s in c.SubPages )
        {
            Response.Write("<li><a href=\"/Home/Page/" + s.ID + "\">" + s.Title + "</a></li>");
        }

        Response.Write("</ul></li>");
    }
     %>
     </ul>